import { Button, message } from "antd";
import type { LocalStorageDataType } from "@/tool/type";

// 示例初始化数据
const demoList: LocalStorageDataType[] = [
  {
    title: "极乐密壶插画集",
    description: "精装铜版纸，内含设计草图以及10副设计草图，揭秘本作的生产秘密",
    img_link: "https://dongbd.com/wp-content/uploads/2025/06/1750871405.webp",
    link: "https://dongbd.com/wp-content/uploads/2025/06/1750871405.webp",
    price: 85,
    target_value: 10000,
    time: ["2025-06-24T16:00:00.000Z", "2025-07-25T16:00:00.000Z"],
    status: 1,
    supported: 82,
    id: "1750987755051c77d8ec2253538",
  },
  {
    title: "极乐密壶卡通立牌",
    description: "小巧可爱的卡通立牌，适合极乐密壶的狂热玩家，可放在桌面上装饰",
    img_link: "https://dongbd.com/wp-content/uploads/2025/06/1750178726.webp",
    link: "https://dongbd.com/wp-content/uploads/2025/06/1750178726.webp",
    price: 12,
    target_value: 3000,
    time: ["2025-06-20T16:00:00.000Z", "2025-08-02T16:00:00.000Z"],
    status: 1,
    supported: 260,
    id: "1750993606673c028f5b1675e7",
  },
  {
    title: "美骨柔姬青春版卡通立牌",
    description: "精心雕刻的立牌，附带唯一编号，限量发行200套，适合收藏",
    img_link: "https://dongbd.com/wp-content/uploads/2025/06/1750353830.webp",
    link: "https://dongbd.com/wp-content/uploads/2025/06/1750353830.webp",
    price: 15,
    target_value: 3000,
    time: ["2025-06-25T16:00:00.000Z", "2025-07-16T16:00:00.000Z"],
    status: 2,
    supported: 18,
    id: "1750996779763396bae1abc50f",
  },
  {
    title: "美骨柔姬青春版插画集",
    description: "精雕细印，铜板印刷，附带唯一编号，限量发行200套，适合收藏",
    img_link: "https://dongbd.com/wp-content/uploads/2025/06/1750353830.webp",
    link: "https://dongbd.com/wp-content/uploads/2025/06/1750353830.webp",
    price: 15,
    target_value: 3000,
    time: ["2025-02-25T16:00:00.000Z", "2025-05-16T16:00:00.000Z"],
    status: 1,
    supported: 58,
    id: "1750996779766696bae1abc50f",
  },
];

//后台数据看板
function App() {
  const handleInit = () => {
    localStorage.setItem("crowdFundingList", JSON.stringify(demoList));
    message.success("本地数据已初始化！");
  };

  return (
    <div style={{ padding: 32 }}>
      <h2>仅做部分功能及众筹流程演示用</h2>
      <Button type="primary" onClick={handleInit}>
        初始化本地数据
      </Button>
    </div>
  );
}

export default App;
